<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    console.log('start')

    function getData() {
        return new Promise(resolve => {
            console.log(555)
            setTimeout(() => {
                resolve(666)
            }, 10)
        })
    }

    async function test() {
        console.log(777)
        let result = await getData()
        console.log(888)
    }

    test()

    setTimeout(() => {
        console.log('setTimeout-1')
    }, 0)

    setTimeout(() => {
        console.log('setTimeout-2')
        setTimeout(() => {
            console.log('setTimeout-3')
        }, 0)
    }, 0)

    console.log('end')

    // start
    // 777
    // 555
    // end
    // setTimeout-1
    // setTimeout-2
    // setTimeout-3
    // 888

</script>
</body>
</html>
